<?php 

$message = '';
$db = new mysqli('localhost', 'root', 'root', 'rashidStone');
if($db->connect_error) {
    $message = $db->connect_error;
} 
$classname = $_POST['classname'];
$maxStudents = $_POST['numStudents'];
$year = $_POST['grade'];
$start = $_POST['start'];
$end = $_POST['end'];


$sql="INSERT INTO Class (Name, MaxNumberStudents, SchoolGrade, StartDate, EndDate)
VALUES ('$classname', '$maxStudents', '$year', '$start', '$end')";

if (!mysqli_query($db,$sql))
{
  die('Error: ' . mysqli_error($db));
}

echo "added class";